package day07;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import dao.EmpDao;
import entity.Emp;

public class AddEmpServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
      
	/**
	 * URL /add-emp
	 */
	protected void doGet(
			HttpServletRequest request, 
			HttpServletResponse response) 
		throws ServletException, IOException {
		EmpDao dao = new EmpDao();
		List<Emp> mgrs = dao.findMgrs();
		request.setAttribute("mgrs", mgrs);
		request.getRequestDispatcher(
				"/WEB-INF/jsp/add-emp.jsp")
				.forward(request, response);
	}
}







